package com.code9xs.mapper;

import com.code9xs.pojo.Association;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
@Mapper
public interface AssociationMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Association record);

    int insertSelective(Association record);

    Association selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Association record);

    int updateByPrimaryKey(Association record);

    /**
     * 判断当前部门名是否存在
     * @param name
     * @return
     */
    int selectIsExistByName(@Param("name") String name);

    /**
     * 分页查询社团信息
     * @param start
     * @param pageSize
     * @return
     */
    List<Map<String,Object>> selectAllAssociation(@Param("start") Integer start, @Param("pageSize") Integer pageSize);

    int selectStatusIsOkAllCount();

    /**
     * 根据用户id 查询用户所有社团信息
     * @param uid
     * @return
     */
    List<Map<String,Object>> selectUserAssociation(@Param("uid") Integer uid);

    /**
     * 查询某个社团所有活动以及社团名
     * @param aid
     * @return
     */
    List<Map<String,Object>> selectItemInfo(@Param("aid")Integer aid);

    /**
     * 根据社团id查询社团banner图
     * @param aid
     * @return
     */
    List<String> getItemBanner(@Param("aid") Integer aid);

    int selectAllAssociationCount();

    List<Map<String,Object>> selectAllAssociationPagination(@Param("start") Integer start,@Param("pageSize") Integer pageSize);
}